package com.study.langchain4j.api;

import com.study.langchain4j.service.AssistantService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xl-9527
 * @since 2025/11/2
 **/
@RestController
@RequestMapping("ai/ai-service/chat")
public class AiServiceChatApi {

    private final AssistantService assistantService;

    public AiServiceChatApi(final AssistantService assistantService) {
        this.assistantService = assistantService;
    }

    @RequestMapping("normal")
    public String normalChat(@RequestParam("userMessage") String userMessage) {
        return assistantService.normalChat(userMessage);
    }

    @RequestMapping("normal-structured")
    public Object normalStructuredChat(@RequestParam("userMessage") String userMessage) {
        return assistantService.normalStructuredChat(userMessage);
    }
}
